package com.zyf.project.capchain.listener.state.impl;

import com.zyf.project.capchain.listener.state.State;

/**
 * @author Zhou Yifan
 */
public enum CommonState implements State {

    /**
     * 操作成功
     */
    SUCCESS() {
        @Override
        public Integer code() {
            return 200;
        }

        @Override
        public String message() {
            return "操作成功";
        }

        @Override
        public Boolean isSuccess() {
            return true;
        }
    },

    /**
     * 操作失败，特指用户操作不当导致的操作失败
     */
    FAILED() {
        @Override
        public Integer code() {
            return 500;
        }

        @Override
        public String message() {
            return "操作失败";
        }

        @Override
        public Boolean isSuccess() {
            return false;
        }
    },
}
